#pragma once
#include <QWidget>
#include <bondlib/BondInfo.h>
#include "BondDetailPage.h"
#include "BondDetailPrimary.h"
class DetailData;
class BondDetailChart;
class BondDetailBroker;
class BondDetailCFETS;
class BondDetailExchange;
class BondDetailTab;
class QHBoxLayout;
class BondDetailPrcArea;
class BondDetailPrcChange;
class BondDetailPrcMyPurchase;
class BondDetailPrcRelevance;

class BondDetailDlg : public BondDetailPage//QWidget
{
public:
	BondDetailDlg(QWidget* parent);
	~BondDetailDlg();
	bool setCombondKey(const char* bondKey = nullptr, int brokerId = -1);

	bool setBroker(int nBrokerId);

protected slots:
	void onTabSelChanged(int brokerid);

private:
	void setupUI(const CBondInfo& pbi,int brokerId); 
	void setupSecondaryUI(int brokerId);
	void setupPrimaryUI();

private:
    QSharedPointer<DetailData> m_data = nullptr;
	BondDetailChart* m_chart = nullptr;
	BondDetailBroker* m_brokerDlg = nullptr;
	BondDetailCFETS* m_cfetsDlg = nullptr;
	BondDetailExchange* m_exDlg = nullptr;
	BondDetailTab* m_tab = nullptr;
	QHBoxLayout* m_quoteLayout = nullptr;
	QWidget* m_secondeDlg = nullptr;
	BondDetailPrimary*				m_primaryDlg = nullptr;
};